package com.share.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.share.dto.SysUserDto;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 *  词库
 * @TableName lexicon
 */
@TableName(value ="lexicon")
@Data
public class Lexicon implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 
     */
    @TableField(value = "name")
    @NotBlank(message = "词条名不能为空")
    private String name;

    /**
     * 
     */
    @TableField(value = "created")
    @JsonSerialize(using=CustomDateTimeSerializer.class)
    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss")
    private Date created;

    /**
     * 
     */
    @TableField(value = "updated")
    @JsonSerialize(using=CustomDateTimeSerializer.class)
    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss")
    private Date updated;

    /**
     * 
     */
    @TableField(value = "statu")
    @NotNull(message = "词条状态不能为空")
    private Integer statu;

    /**
     * 
     */
    @TableField(value = "remark")
    private String remark;

    @TableField(value ="uid")  //创建者id
    private Long uid;


    @TableField(exist = false)
    private List<Catelog> catelogs = new ArrayList<>();


    @TableField(exist = false)
    private SysUserDto user;


    @TableField(exist = false)
    private List<Angle> angles;





    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}